home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c++ / 275 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.6 KB

  1. Path: engnews1.Eng.Sun.COM!taumet!clamage
  2. From: JKLIER@news-feed.delphi.com (JKLIER@DELPHI.COM)
  3. Newsgroups: comp.std.c++
  4. Subject: Re: #ifdef XXXX
  5. Date: 3 Feb 1996 17:17:32 GMT
  6. Organization: Delphi Internet Services Corporation
  7. Approved: clamage@eng.sun.com (comp.std.c++)
  8. Message-ID: <4evnmo$msp@news2.delphi.com>
  9. References: <1996Feb1.092058.4745@iiasa.ac.at> <3112531A.3410@ElSegundoCA.ATTGIS.COM>
  10. NNTP-Posting-Host: taumet.eng.sun.com
  11. Content-Type: text
  12. Content-Length: 915
  13. Originator: clamage@taumet
  14.  
  15. "Charles F. McDevitt" <Chuck.McDevitt@elsegundoca.attgis.com> writes:
  16.  
  17. >Wouldn't it be better to update the C++ standard so the
  18. >default is that include files only get included once, and the
  19. >compiler/preprocessor keeps track of which ones it's already 
  20. >seen.  Then we wouldn't have to mess with these ugly #ifdefs
  21. >to make include files only be included once.
  22.  
  23. Not necessarily a good idea. What about if another header file adds a define
  24. and running thru the header file a second time includes a different contents
  25. than the first time around.
  26. This is a very common practice in imake config files for example, which use
  27. the preprocessor from C to process all the include files. And it would have
  28. to be the preprocessor to take care of the tracking.
  29. I can't imagine what a nightmare that would be to get some of the old
  30. stuff to compile ;-) - not that I think that this is a very good coding
  31. practice.
  32.  
  33.                             Jan
  34.  
  35.  
  36. [ comp.std.c++ is moderated.  Submission address: std-c++@ncar.ucar.edu.
  37.   Contact address: std-c++-request@ncar.ucar.edu.  The moderation policy is
  38.   summarized in http://reality.sgi.com/employees/austern_mti/std-c++/policy.html
  39. ]
  40.